﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
using Project.Application;

namespace Project.AdminAPI.Controllers
{
    [Route("api/[controller]")]
    [ApiController]
    //[Authorize]
    public class AuthController : ControllerBase
    {
        private readonly IUserAppService _userService;
        public AuthController(IUserAppService userService)
        {
            _userService = userService;
        }

        [HttpGet(nameof(Index))]
        public IEnumerable<string> Index()
        {
            return new string[] { "Demo1", "Demo2" };
        }

        [HttpPost("LoginPost")]
        public IEnumerable<string> LoginPost([FromBody] UserLoginRequestDto loginDto)
        {
            return _userService.Login(loginDto);
        }
    }
}
